// programentry.cpp : contains the winmain function where program execution begins
//$Id: ProgramEntry.cpp 39 2009-09-01 02:50:48Z brwarner2 $
#include "stdafx.h"
#include "WindowFactory.h"
#include "MainControl.h"
#include "SpriteWindow.h"
#pragma comment(lib, "gdiplus.lib")
#pragma comment(lib, "COMCTL32.lib")
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' " "version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")

int WINAPI WinMain( HINSTANCE, HINSTANCE, LPSTR, int )
{
	//Startup GDI+
	ULONG_PTR gdiToken;
	Gdiplus::GdiplusStartupInput input;
	Gdiplus::GdiplusStartup(&gdiToken, &input, 0);

	//Initialize common controls
	InitCommonControls();

	//Register window classes
	CMainControl* pWnd = GetFactory<CMainControl>()->Create();
	MSG msg;
	while( GetMessage(&msg, 0, 0, 0) > 0 )
	{
		TranslateMessage(&msg);
		DispatchMessage(&msg);
	}
	Gdiplus::GdiplusShutdown(gdiToken);
	return (int)msg.wParam;
}